<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> 
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title><decorator:title/></title>
    <link href="<%=request.getContextPath()%>/static/components/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/static/components/metisMenu/metisMenu.min.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/static/components/sbAdmin/css/sb-admin-2.css" rel="stylesheet">
    <link href="<%=request.getContextPath()%>/static/components/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="<%=request.getContextPath()%>/static/components/gjp-admin/css/gjp-admin.css" rel="stylesheet">
	
    <script src="<%=request.getContextPath()%>/static/components/jquery/jquery.min.js"></script>
    <script src="<%=request.getContextPath()%>/static/components/bootstrap/js/bootstrap.min.js"></script>
    <script src="<%=request.getContextPath()%>/static/components/metisMenu/metisMenu.min.js"></script>
    <script src="<%=request.getContextPath()%>/static/components/sbAdmin/js/sb-admin-2.js"></script>
    
    <decorator:head/>
    
</head>

<body style="font-family: 微软雅黑;">

    <div id="wrapper">

        <nav class="navbar navbar-default navbar-static-top" role="navigation" style="margin-bottom: 0;">
            <div class="navbar-header">
                <a class="navbar-brand" href="<%=request.getContextPath()%>/home">GJP-Admin</a>
            </div>

            <ul class="nav navbar-top-links navbar-right">
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-user fa-fw"></i>  <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li><a href="javscript:;"><i class="fa fa-gear fa-fw"></i>个人设置</a>
                        </li>
                        <li class="divider"></li>
                        <li><a href="<%=request.getContextPath()%>/loginout"><i class="fa fa-sign-out fa-fw"></i>退出登录</a>
                        </li>
                    </ul>
                </li>
            </ul>
			
            <div class="navbar-default sidebar" role="navigation">
                <div class="sidebar-nav navbar-collapse">
                    <ul class="nav fontSize16" id="side-menu">
                    
                        <li class="sidebar-search">
                            <div class="input-group custom-search-form">
                                <input type="text" class="form-control" placeholder="查询...">
                                <span class="input-group-btn">
                                <button class="btn btn-default" type="button">
                                    <i class="fa fa-search"></i>
                                </button>
                            </span>
                            </div>
                        </li>
                        
                        <c:forEach items="${user.menuList }" var="menu">
	                        <c:forEach items="${menu.childMenus }" var="secondMenu">
								<c:if test="${secondMenu.userHasRight}">
			                        <li id="second_level_li_${menu.id}_${secondMenu.id}" style="display: none;">
			                            <a first_level_id="${menu.id}" href="${null != secondMenu.url ? secondMenu.url : 'javascript:;' }"><i class="fa fa-bar-chart-o fa-fw"></i> ${secondMenu.name }
				                            <c:if test="${fn:length(secondMenu.childMenus) > 0}">
				                            	<span class="fa arrow"></span>
				                            </c:if>
			                            </a>
		                                <c:if test="${fn:length(secondMenu.childMenus) > 0}">
			                                <ul class="nav nav-second-level">
				                                <c:forEach items="${secondMenu.childMenus }" var="thirdMenu">
				                        			<li>
				                                    	<a href="${null != thirdMenu.url ? thirdMenu.url : 'javascript:;' }">${thirdMenu.name }</a>
				                                	</li>
			                            		</c:forEach>
				                            </ul>
			                            </c:if>
			                        </li>
								</c:if>
							</c:forEach>
						</c:forEach>
                    </ul>
                </div>
            </div>
        </nav>

		<c:if test="${null != user and null != user.menuList}">
			<div class="first-menu-nav">
				<c:forEach items="${user.menuList }" var="menu">
					<c:if test="${menu.userHasRight}">
						<div class="${menu.panel }" id="first_level_${menu.id }" menu_id="${menu.id }">
							<span class="glyphicon ${menu.icon } glyphicon" aria-hidden="true"></span>
							<div class="title"><span class="glyphicon-class">${menu.name }</span></div>
						</div>
					</c:if>
				</c:forEach>
			</div>
		</c:if>
		
        <div id="page-wrapper">
        	<decorator:body/>
        </div>

    </div>

</body>

</html>
